/**
 * @author: 颜色
 * @description: xhr相关类型定义
 */
import { PlainObject, PrimitiveType } from "./base";
import { RecordDTO } from "./dto";
// 条件Model
export interface LoginModel extends PlainObject {
    userName: string
    userKey: string
    projectAlias: string
}
export interface PasswordModel extends PlainObject{
    newPassword: string
}

export interface TabelModel extends PlainObject {
    pageNum: number;
    pageSize: number
}
// 响应Model
export interface CommonResponse<T = unknown> {
    error_code: string;
    success: boolean;
    error_msg: string;
    data?: T | T[];
}

export interface RecordResponse<T extends RecordDTO> extends CommonResponse {
    data: T;
}

export interface ArrayResponse<T extends RecordDTO> extends CommonResponse {
    data: T[];
}

export interface PageResponse<T extends RecordDTO> extends CommonResponse {
    data: T[];
    total: number;
}

export interface PlainResponse<T extends PrimitiveType> extends CommonResponse {
    data: T;
}